import time

from hytest import STEP,INFO,CHECK_POINT,GSTORE
from lib.button import *

def suite_setup():
    time_now = time.strftime('%Y%m%d_%H%M%S', time.localtime())
    homework_name = f'homework_{time_now}'
    GSTORE['test_homework_name'] = homework_name
    GSTORE['thomework_create'].input(GSTORE['thomework_create'].loc_homework_name, homework_name)
    GSTORE['thomework_create'].select_question()
    GSTORE['iframe_homework_create'].jump()
    GSTORE['homework_name'] = homework_name
    GSTORE['iframe_homework_create'].click_buttons([button_本页全加入,button_确定])
    GSTORE['iframe_homework_create'].leave_iframe()
    GSTORE['thomework_create'].submit()

    GSTORE['thomework_create'].click(GSTORE['thomework_create'].loc_pop_not_release)
    time.sleep(1)  # 不可删除强制等待

def suite_teardown():
    GSTORE['thome'].return_home()
    GSTORE['thome'].open_homework_create()



